package modelLag;
import java.util.ArrayList;

/**
 * Description of the class Product.
 * 
 * @author (Christian, Umut, Christoffer, Patrick, Simon) 
 * @project (Semesterprojekt)
 * @version (2014.12.09)
 */
public class Product
{
    private int ID;
    private String description;
    private String name;
    private double price;
    private int stock;
    private int location;
    private int sold;
    private ArrayList<Copy> copies;
    private ArrayList<PartsList> parts;
    
    /**
     * Constructor for objects of class Product
     * 
     * @param ID is the user input for the ID of a Product.
     * @param description is the user input for the description of a Product.
     * @param price is the user input for the price of a Product.
     * @param location is the user input for the location of a Product.
     * @param stock is the user input for the stock of a Product.
     * @param ArrayList<Copy> is the user input for the copies of a Product.
     * @param ArrayList<PartsList> is the user input for the parts of a Product. 
     */
    public Product(int ID, String name, String description, double price, int location, int stock){
      this.ID = ID;
      this.description = description;
      this.price = price;
      this.location = location;
      this.stock = stock;
      this.name = name;
      sold = 0;
      copies = new ArrayList<Copy>();
      parts = new ArrayList<PartsList>();
    }

    /**
    * Return the ID of the product.
    */
    public int getID(){
      return ID;  
    }
    
    /**
    * Return the Name of the product.
    */
    public String getName(){
      return name;
    }
    
    /**
    * Return the Price of the product.
    */
    public double getPrice(){
      return price;
    }
    
    /**
    * Return the Stock of the product.
    */
    public int getStock(){
      return stock;
    }
    
    /**
    * Return the Description of the product.
    */
    public String getInfo(){
        return description;
    }
    
    /**
    * Return the Location of the product.
    */
    public int getLocation (){
        return location;
    }
    
    /**
    * Decreases the amount of a product in stock.
    */
    public void decrementStock(int amount){
      stock -= amount;
    }
    
    /**
    * Adds to the statistics for sold products.
    */
    public void incrementSold(int amount){
        sold += amount;
    }
    
}
